package com.wiscamp.ninechapters.problems.infrastructure.po.collections;

import com.wiscamp.ninechapters.ddd.PersistenceObject;
import jakarta.persistence.*;
import lombok.Data;

import java.io.Serial;
import java.time.LocalDateTime;

/**
 * 题集
 */
@Table(name = "problem_collections")
@Data
@Entity
public class ProblemCollectionPO implements PersistenceObject {

    @Serial
    private static final long serialVersionUID = 2010528023506462315L;

    /**
     * 题集编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "collection_id", insertable = false, nullable = false)
    private long collectionId = 0;

    /**
     * 题集代码
     */
    @Column(name = "collection_code", nullable = false)
    private String collectionCode = "";

    /**
     * 题集名称
     */
    @Column(name = "collection_name", nullable = false)
    private String collectionName = "";

    /**
     * 题集类别
     */
    @Column(name = "collection_category_id", nullable = false)
    private int collectionCategoryId = 0;

    /**
     * 机构编号
     */
    @Column(name = "organization_id", nullable = false)
    private long organizationId = 0;

    /**
     * 考试编号
     */
    @Column(name = "exam_id", nullable = false)
    private long examId = 0;

    /**
     * 学科编号
     */
    @Column(name = "subject_id", nullable = false)
    private long subjectId = 0;

    /**
     * 语言代码
     */
    @Column(name = "language_code")
    private String languageCode = "";

    /**
     * 题数量
     */
    @Column(name = "problem_quantity", nullable = false)
    private int problemQuantity = 0;

    /**
     * 总分
     */
    @Column(name = "total_score", nullable = false)
    private int totalScore = 0;

    /**
     * 总时间限制
     */
    @Column(name = "total_time_limit", nullable = false)
    private int totalTimeLimit = 0;

    /**
     * 是否真题
     */
    @Column(name = "true_problem", nullable = false)
    private boolean trueProblem = false;

    /**
     * 题集来源
     */
    @Column(name = "collection_source")
    private String collectionSource = "";

    /**
     * 题集摘要
     */
    @Column(name = "collection_summary")
    private String collectionSummary = "";

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark = "";

    /**
     * 是否可用
     */
    @Column(name = "is_active", nullable = false)
    private boolean enabled = true;

    /**
     * 是否删除
     */
    @Column(name = "is_deleted", nullable = false)
    private boolean deleted = false;

    /**
     * 创建用户
     */
    @Column(name = "created_by", nullable = false)
    private long creatorId = 0;

    /**
     * 创建时间
     */
    @Column(name = "created_time", nullable = false)
    private LocalDateTime creationTime;

    /**
     * 编辑用户
     */
    @Column(name = "modified_by")
    private long modifierId = 0;

    /**
     * 编辑时间
     */
    @Column(name = "modified_time")
    private LocalDateTime modificationTime;


}